package card;

import place.Landindex;
import PJ.Entrance;
import PJ.Player;

public class EqualizedWealthCard extends CardSystem {
	//均富卡
	String name="EqualizedWealthCard";
	String function="将所有人的现金平均分配";	
	String type="MagicCard";
	String range="其他玩家（无视距离）";
	EqualizedWealthCard(){
		int point=40;
		this.point=point;
	}	
	@Override
	public String getName() {
		
		return name;
	}

	@Override
	public String getFunction() {
		// TODO Auto-generated method stub
		return function;
	}

	@Override
	public String getType() {
		// TODO Auto-generated method stub
		return type;
	}
	@Override
	public int getPoint() {
		return point;
	}
	@Override
	public String getRange() {
		// TODO Auto-generated method stub
		return range;
	}
	@Override
	public void print(int location, int namei) {
		// TODO Auto-generated method stub
		int tmp=0;
		for(int i=0;i<Entrance.players.size();i++){
			tmp+=Entrance.players.get(i).getCash();
		}	
		tmp=tmp/(Entrance.players.size());
		for(int i=0;i<Entrance.players.size();i++){
			Entrance.players.get(i).setCash(tmp);
		}	
		System.out.println("卡牌使用成功");	
	}
}
